<template>
    <div>
        <el-button size="small" type="primary" @click="openTaxEditUI(null)">添加税率</el-button>

        <el-table :data="buildingNumberList" border stripe 
            @header-click="clickFun" style="width: 100%" :header-cell-style="{ 'text-align': 'center' }"
            :cell-style="{ 'text-align': 'center' }">
            <el-table-column label="增值税测算表">
                <el-table-column prop="num" label="序号" width="180">
                </el-table-column>
                <el-table-column prop="title" label="项目" width="180">
                </el-table-column>
                <el-table-column :label="item" align="center" :prop="`list.${index}`"
                    v-for="(item, index) in shuilvList" :key="index">
                </el-table-column>
                <el-table-column prop="sum" label="总计" :formatter="stateFormat">
                </el-table-column>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import calculateApi from '@/api/calculate'

export default {
    data() {
        return {
            calculate_id: '',
            buildingNumberList: [],
            shuilvList: [],
            sumList: [],
        }

    },
    methods: {
        getCalculateBuildingNumberList() {
            calculateApi.getCalculateBuildingNumberList(this.calculate_id).then(response => {
                this.buildingNumberList = response.data.zzscsbList.list;
                this.shuilvList = response.data.zzscsbList.shuilvList;
            })
        },
    },
    created() {
        var query = this.$route.query;
        if (query.id) {
            this.calculate_id = query.id;
        }

        this.getCalculateBuildingNumberList();
    },
}
</script>

<style></style>